#include "processbar.h"

void process2(callback_t cb)
{
    srand(time(NULL)^1023);
    int total= FILESIZE;
    int once=rand()%(1024*1024*4);
    while(total)
    {
        usleep(10000);
        total-=once;
        int download=FILESIZE-total;
        double rate=((download*1.0)/(FILESIZE))*100;
        if(total<0) total=0;
        cb(rate);
    }
}

int main()
{
    process();
    process2(process_flush);
     return 0;
}

